<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>支付方式</title>

    <link rel="stylesheet" href="/templates/index/vendors/font-awesome/4.5.0/css/font-awesome.min.css">
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/??sm.min.css,sm-extend.min.css">
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/??sm.min.js,sm-extend.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="/templates/index/css/order.css">
</head>
<body>
<div class="page-group">
    <div class="page page-current">
        <header class="bar bar-nav">
            <a href="javascript:history.back(-1);" class="icon icon-left pull-left"></a>
            <h1 class="title">支付方式</h1>
        </header>
        <div class="content native-scroll">
            {foreach $order_list as $order_item}
            <div class="content-block-title">订单详情</div>
            <div class="list-block">
                <ul>
                    <li class="item-content">
                        <div class="item-media"><i class="icon icon-f7"></i></div>
                        <div class="item-inner">
                            <div class="item-title">订单号</div>
                            <div class="item-after">{$order_item.order_sn}</div>
                        </div>
                    </li>
                    <li class="item-content">
                        <div class="item-media"><i class="icon icon-f7"></i></div>
                        <div class="item-inner">
                            <div class="item-title">商家</div>
                            <div class="item-after">{$order_item.store_name}</div>
                        </div>
                    </li>
                    <li class="item-content">
                        <div class="item-media"><i class="icon icon-f7"></i></div>
                        <div class="item-inner">
                            <div class="item-title">金额</div>
                            <div class="item-after">{$order_item.order_amount}</div>
                        </div>
                    </li>

                </ul>
            </div>
            {/foreach}
            <div class="content-block-title">支付金额</div>
            <div class="list-block">
                <ul>
                    <li class="item-content">
                        <div class="item-inner">
                            <div class="item-title">合计{$order_amount}元</div>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="content-block-title">选择在线支付</div>
            <div class="content-block">
                <!--<p><a href="#" class="button button-big button-fill">支付宝</a></p>-->
                <p><a href="#" class="button button-big button-fill button-success" id="weixinsaoma">微信扫码</a></p>
            </div>
        </div>
    </div>
</div>
<!-- About Popup -->
<div class="popup popup-about">
    <div class="content-block">
        <p><a href="#" class="close-popup">关闭</a></p>
        <p><img id="qrcode_url" src="" /></p>
        <p>长按图片[识别二维码]付款</p>
        <p><a href="/index/order">我已经支付成功！</a></p>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        //微信扫码支付
       $('#weixinsaoma').click(function(){
           var pay_sn = '{$order_item.pay_sn}';
           var data = {pay_type:'weixin',pay_sn:pay_sn};
           $.post('/index/pay/real_order',data,function(result){
               $('#qrcode_url').attr('src','/index/pay/qrcode?url='+result.msg);
               $.popup('.popup-about');
           },'json');
       }) ;
    });
</script>
</body>
</html>